 <template>
   <Card :shadow="shadow">
      <div class="card-name">
        <div class="name width1">权限列表</div>
      </div>
      <div class="content-con">
        <div class="form-item">
          <Tree :data="menuTree" show-checkbox></Tree>
        </div>
        <div class="ban-btn border-top">
          <i-button class="save" size="large">保存</i-button>
          <i-button class="save" size="large" @click="btnClick1">返回</i-button>
        </div>
      </div>
   </Card>

 </template>
<script>
import { ifArrVal } from '@/libs/tools'
export default {
  name: 'role-power',
  props: {
    shadow: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      value: '',
      menuTree: []
    }
  },
  created () {
    this.getMenuTree()
  },
  methods: {
    getMenuTree () {
      this.menuTree = []
      let menuData = this.$store.state.user.userInfo
      this.menuTree = this.menuTree.concat(menuData.menuList)
      let da = ifArrVal(this.menuTree, '代付管理')
      let rules = this.$route.params.rules.split('--')
      for (let i = 0; i < rules.length; i++) {
        ifArrVal(this.menuTree, rules[i])
      }
      console.log(rules)
    },
    // 返回按钮
    btnClick1 () {
      this.$router.push({ name: 'role_management' })
    }
  }
}
</script>
 <style lang="less">

  .ivu-tree ul li{
    font-size: 14px !important;
  }
  .border-top{
    margin-top: 30px;
    border-top: 1px solid #eee;
  }
 </style>
